home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / AppleEvents.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  25.6 KB  |  931 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleEvents.a
  3. ;
  4. ;    Contains:    AppleEvent Package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  21. __APPLEEVENTS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  25.     include 'Errors.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  30.     include 'Types.a'
  31.     ENDIF
  32.  
  33.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  34.     include 'Memory.a'
  35.     ENDIF
  36. ;        include 'MixedMode.a'                                        ;
  37.  
  38.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  39.     include 'OSUtils.a'
  40.     ENDIF
  41.  
  42.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  43.     include 'Events.a'
  44.     ENDIF
  45. ;        include 'Quickdraw.a'                                        ;
  46. ;            include 'QuickdrawText.a'                                ;
  47.  
  48.     IF &TYPE('__EPPC__') = 'UNDEFINED' THEN
  49.     include 'EPPC.a'
  50.     ENDIF
  51. ;        include 'AppleTalk.a'                                        ;
  52. ;        include 'Files.a'                                            ;
  53. ;        include 'PPCToolbox.a'                                        ;
  54. ;        include 'Processes.a'                                        ;
  55.  
  56.     IF &TYPE('__NOTIFICATION__') = 'UNDEFINED' THEN
  57.     include 'Notification.a'
  58.     ENDIF
  59.  
  60. ; Apple event descriptor types 
  61. typeBoolean                        EQU        'bool'
  62. typeChar                        EQU        'TEXT'
  63. typeSMInt                        EQU        'shor'
  64. typeInteger                        EQU        'long'
  65. typeSMFloat                        EQU        'sing'
  66. typeFloat                        EQU        'doub'
  67. typeLongInteger                    EQU        'long'
  68. typeShortInteger                EQU        'shor'
  69. typeLongFloat                    EQU        'doub'
  70. typeShortFloat                    EQU        'sing'
  71. typeExtended                    EQU        'exte'
  72. typeComp                        EQU        'comp'
  73. typeMagnitude                    EQU        'magn'
  74. typeAEList                        EQU        'list'
  75. typeAERecord                    EQU        'reco'
  76. typeAppleEvent                    EQU        'aevt'
  77. typeTrue                        EQU        'true'
  78. typeFalse                        EQU        'fals'
  79. typeAlias                        EQU        'alis'
  80. typeEnumerated                    EQU        'enum'
  81. typeType                        EQU        'type'
  82. typeAppParameters                EQU        'appa'
  83. typeProperty                    EQU        'prop'
  84. typeFSS                            EQU        'fss '
  85. typeKeyword                        EQU        'keyw'
  86. typeSectionH                    EQU        'sect'
  87. typeWildCard                    EQU        '****'
  88. typeApplSignature                EQU        'sign'
  89. typeQDRectangle                    EQU        'qdrt'
  90. typeFixed                        EQU        'fixd'
  91. typeSessionID                    EQU        'ssid'
  92. typeTargetID                    EQU        'targ'
  93. typeProcessSerialNumber            EQU        'psn '
  94. typeNull                        EQU        'null'                ; null or nonexistent data 
  95. ; Keywords for Apple event parameters 
  96. keyDirectObject                    EQU        '----'
  97. keyErrorNumber                    EQU        'errn'
  98. keyErrorString                    EQU        'errs'
  99. keyProcessSerialNumber            EQU        'psn '
  100. ; Keywords for Apple event attributes 
  101. keyTransactionIDAttr            EQU        'tran'
  102. keyReturnIDAttr                    EQU        'rtid'
  103. keyEventClassAttr                EQU        'evcl'
  104. keyEventIDAttr                    EQU        'evid'
  105. keyAddressAttr                    EQU        'addr'
  106. keyOptionalKeywordAttr            EQU        'optk'
  107. keyTimeoutAttr                    EQU        'timo'
  108. keyInteractLevelAttr            EQU        'inte'                ; this attribute is read only - will be set in AESend 
  109. keyEventSourceAttr                EQU        'esrc'                ; this attribute is read only 
  110. keyMissedKeywordAttr            EQU        'miss'                ; this attribute is read only 
  111. keyOriginalAddressAttr            EQU        'from'                ; new in 1.0.1 
  112. ; Keywords for special handlers 
  113. keyPreDispatch                    EQU        'phac'                ; preHandler accessor call 
  114. keySelectProc                    EQU        'selh'                ; more selector call 
  115. ; Keyword for recording 
  116. keyAERecorderCount                EQU        'recr'                ; available only in vers 1.0.1 and greater 
  117. ; Keyword for version information 
  118. keyAEVersion                    EQU        'vers'                ; available only in vers 1.0.1 and greater 
  119. ; Event Class 
  120. kCoreEventClass                    EQU        'aevt'
  121. ; Event ID’s 
  122. kAEOpenApplication                EQU        'oapp'
  123. kAEOpenDocuments                EQU        'odoc'
  124. kAEPrintDocuments                EQU        'pdoc'
  125. kAEQuitApplication                EQU        'quit'
  126. kAEAnswer                        EQU        'ansr'
  127. kAEApplicationDied                EQU        'obit'
  128.  
  129. ; Constants for use in AESend mode 
  130. kAENoReply                        EQU        $00000001            ; sender doesn't want a reply to event 
  131. kAEQueueReply                    EQU        $00000002            ; sender wants a reply but won't wait 
  132. kAEWaitReply                    EQU        $00000003            ; sender wants a reply and will wait 
  133. kAENeverInteract                EQU        $00000010            ; server should not interact with user 
  134. kAECanInteract                    EQU        $00000020            ; server may try to interact with user 
  135. kAEAlwaysInteract                EQU        $00000030            ; server should always interact with user where appropriate 
  136. kAECanSwitchLayer                EQU        $00000040            ; interaction may switch layer 
  137. kAEDontReconnect                EQU        $00000080            ; don't reconnect if there is a sessClosedErr from PPCToolbox 
  138. kAEWantReceipt                    EQU        nReturnReceipt        ; sender wants a receipt of message 
  139. kAEDontRecord                    EQU        $00001000            ; don't record this event - available only in vers 1.0.1 and greater 
  140. kAEDontExecute                    EQU        $00002000            ; don't send the event for recording - available only in vers 1.0.1 and greater 
  141. ; Constants for the send priority in AESend 
  142. kAENormalPriority                EQU        $00000000            ; post message at the end of the event queue 
  143. kAEHighPriority                    EQU        nAttnMsg            ; post message at the front of the event queue 
  144.  
  145. ; Constants for recording 
  146. kAEStartRecording                EQU        'reca'                ; available only in vers 1.0.1 and greater 
  147. kAEStopRecording                EQU        'recc'                ; available only in vers 1.0.1 and greater 
  148. kAENotifyStartRecording            EQU        'rec1'                ; available only in vers 1.0.1 and greater 
  149. kAENotifyStopRecording            EQU        'rec0'                ; available only in vers 1.0.1 and greater 
  150. kAENotifyRecording                EQU        'recr'
  151.  
  152. ; Constant for the returnID param of AECreateAppleEvent 
  153. kAutoGenerateReturnID            EQU        -1                    ; AECreateAppleEvent will generate a session-unique ID 
  154. ; Constant for transaction ID’s 
  155. kAnyTransactionID                EQU        0                    ; no transaction is in use 
  156. ; Constants for timeout durations 
  157. kAEDefaultTimeout                EQU        -1                    ; timeout value determined by AEM 
  158. kNoTimeOut                        EQU        -2                    ; wait until reply comes back, however long it takes 
  159.  
  160. ; Constants for AEResumeTheCurrentEvent 
  161. kAENoDispatch                    EQU        0                    ; dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch 
  162. kAEUseStandardDispatch            EQU        $FFFFFFFF            ; table, or one of these two constants 
  163. ; Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch 
  164. kAEDoNotIgnoreHandler            EQU        $00000000
  165. kAEIgnoreAppPhacHandler            EQU        $00000001            ; available only in vers 1.0.1 and greater 
  166. kAEIgnoreAppEventHandler        EQU        $00000002            ; available only in vers 1.0.1 and greater 
  167. kAEIgnoreSysPhacHandler            EQU        $00000004            ; available only in vers 1.0.1 and greater 
  168. kAEIgnoreSysEventHandler        EQU        $00000008            ; available only in vers 1.0.1 and greater 
  169. kAEIngoreBuiltInEventHandler    EQU        $00000010            ; available only in vers 1.0.1 and greater 
  170. kAEDontDisposeOnResume            EQU        $80000000            ; available only in vers 1.0.1 and greater 
  171.  
  172. ; Apple event manager data types 
  173. ; typedef FourCharCode         AEEventClass
  174. ; typedef FourCharCode         AEEventID
  175. ; typedef FourCharCode         AEKeyword
  176. ; typedef ResType             DescType
  177. AEDesc                     RECORD    0
  178. descriptorType             ds.l   1        ; offset: $0 (0)
  179. dataHandle                 ds.l   1        ; offset: $4 (4)
  180. sizeof                     EQU *            ; size:   $8 (8)
  181.                         ENDR
  182.  
  183. ; typedef struct AEDesc     AEDesc
  184. AEKeyDesc                 RECORD    0
  185. descKey                     ds.l   1        ; offset: $0 (0)
  186. descContent                 ds     AEDesc    ; offset: $4 (4)
  187. sizeof                     EQU *            ; size:   $C (12)
  188.                         ENDR
  189.  
  190. ; typedef struct AEKeyDesc     AEKeyDesc
  191. ; an AEDesc which contains address data 
  192. ; typedef AEDesc             AEAddressDesc
  193. ; a list of AEDesc's is a special kind of AEDesc 
  194. ; typedef AEDesc             AEDescList
  195. ; AERecord is a list of keyworded AEDesc's 
  196. ; typedef AEDescList         AERecord
  197. ; an AERecord that contains an AppleEvent 
  198. ; typedef AERecord             AppleEvent
  199. ; parameter to AESend 
  200. ; typedef long                 AESendMode
  201. ; priority param of AESend 
  202. ; typedef short             AESendPriority
  203.  
  204. kAEInteractWithSelf                EQU        0
  205. kAEInteractWithLocal            EQU        1
  206. kAEInteractWithAll                EQU        2
  207.  
  208. ; typedef SInt8             AEInteractAllowed
  209.  
  210. kAEUnknownSource                EQU        0
  211. kAEDirectCall                    EQU        1
  212. kAESameProcess                    EQU        2
  213. kAELocalProcess                    EQU        3
  214. kAERemoteProcess                EQU        4
  215.  
  216. ; typedef SInt8             AEEventSource
  217.  
  218. kAEDataArray                    EQU        0
  219. kAEPackedArray                    EQU        1
  220. kAEHandleArray                    EQU        2
  221. kAEDescArray                    EQU        3
  222. kAEKeyDescArray                    EQU        4
  223.  
  224. ; typedef SInt8             AEArrayType
  225. AEArrayData             RECORD    0
  226. kAEDataArray             ds.w   1        ; offset: $0 (0)
  227.                          ORG 0
  228. kAEPackedArray             ds.b   1        ; offset: $0 (0)
  229.                          ORG 0
  230. kAEHandleArray             ds.l   1        ; offset: $0 (0)
  231.                          ORG 0
  232. kAEDescArray             ds     AEDesc    ; offset: $0 (0)
  233.                          ORG 0
  234. kAEKeyDescArray             ds     AEKeyDesc ; offset: $0 (0)
  235.                          ORG 12
  236. sizeof                     EQU *            ; size:   $C (12)
  237.                         ENDR
  238.  
  239. ; typedef union AEArrayData  AEArrayData
  240. ; typedef AEArrayData         *AEArrayDataPointer
  241. ; typedef UniversalProcPtr     AECoercionHandlerUPP
  242. ;*************************************************************************
  243. ; The following calls apply to any AEDesc. Every 'result' descriptor is
  244. ; created for you, so you will be responsible for memory management
  245. ; (including disposing) of the descriptors so created. Note: purgeable
  246. ; descriptor data is not supported - the AEM does not call LoadResource.  
  247. ;*************************************************************************
  248. ;
  249. ; pascal OSErr AECreateDesc(DescType typeCode, const void *dataPtr, Size dataSize, AEDesc *result)
  250. ;
  251.     IF ¬ GENERATINGCFM THEN
  252.         Macro
  253.         _AECreateDesc
  254.             move.w    #$0825,d0
  255.             dc.w     $A816
  256.         EndM
  257.     ELSE
  258.         IMPORT_CFM_FUNCTION    AECreateDesc
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal OSErr AECoercePtr(DescType typeCode, const void *dataPtr, Size dataSize, DescType toType, AEDesc *result)
  263. ;
  264.     IF ¬ GENERATINGCFM THEN
  265.         Macro
  266.         _AECoercePtr
  267.             move.w    #$0A02,d0
  268.             dc.w     $A816
  269.         EndM
  270.     ELSE
  271.         IMPORT_CFM_FUNCTION    AECoercePtr
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal OSErr AECoerceDesc(const AEDesc *theAEDesc, DescType toType, AEDesc *result)
  276. ;
  277.     IF ¬ GENERATINGCFM THEN
  278.         Macro
  279.         _AECoerceDesc
  280.             move.w    #$0603,d0
  281.             dc.w     $A816
  282.         EndM
  283.     ELSE
  284.         IMPORT_CFM_FUNCTION    AECoerceDesc
  285.     ENDIF
  286.  
  287. ;
  288. ; pascal OSErr AEDisposeDesc(AEDesc *theAEDesc)
  289. ;
  290.     IF ¬ GENERATINGCFM THEN
  291.         Macro
  292.         _AEDisposeDesc
  293.             move.w    #$0204,d0
  294.             dc.w     $A816
  295.         EndM
  296.     ELSE
  297.         IMPORT_CFM_FUNCTION    AEDisposeDesc
  298.     ENDIF
  299.  
  300. ;
  301. ; pascal OSErr AEDuplicateDesc(const AEDesc *theAEDesc, AEDesc *result)
  302. ;
  303.     IF ¬ GENERATINGCFM THEN
  304.         Macro
  305.         _AEDuplicateDesc
  306.             move.w    #$0405,d0
  307.             dc.w     $A816
  308.         EndM
  309.     ELSE
  310.         IMPORT_CFM_FUNCTION    AEDuplicateDesc
  311.     ENDIF
  312.  
  313. ;*************************************************************************
  314. ;  The following calls apply to AEDescList. Since AEDescList is a subtype of
  315. ;  AEDesc, the calls in the previous section can also be used for AEDescList.
  316. ;  All list and array indices are 1-based. If the data was greater than
  317. ;  maximumSize in the routines below, then actualSize will be greater than
  318. ;  maximumSize, but only maximumSize bytes will actually be retrieved.
  319. ;*************************************************************************
  320. ;
  321. ; pascal OSErr AECreateList(const void *factoringPtr, Size factoredSize, Boolean isRecord, AEDescList *resultList)
  322. ;
  323.     IF ¬ GENERATINGCFM THEN
  324.         Macro
  325.         _AECreateList
  326.             move.w    #$0706,d0
  327.             dc.w     $A816
  328.         EndM
  329.     ELSE
  330.         IMPORT_CFM_FUNCTION    AECreateList
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal OSErr AECountItems(const AEDescList *theAEDescList, long *theCount)
  335. ;
  336.     IF ¬ GENERATINGCFM THEN
  337.         Macro
  338.         _AECountItems
  339.             move.w    #$0407,d0
  340.             dc.w     $A816
  341.         EndM
  342.     ELSE
  343.         IMPORT_CFM_FUNCTION    AECountItems
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal OSErr AEPutPtr(AEDescList *theAEDescList, long index, DescType typeCode, const void *dataPtr, Size dataSize)
  348. ;
  349.     IF ¬ GENERATINGCFM THEN
  350.         Macro
  351.         _AEPutPtr
  352.             move.w    #$0A08,d0
  353.             dc.w     $A816
  354.         EndM
  355.     ELSE
  356.         IMPORT_CFM_FUNCTION    AEPutPtr
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal OSErr AEPutDesc(AEDescList *theAEDescList, long index, const AEDesc *theAEDesc)
  361. ;
  362.     IF ¬ GENERATINGCFM THEN
  363.         Macro
  364.         _AEPutDesc
  365.             move.w    #$0609,d0
  366.             dc.w     $A816
  367.         EndM
  368.     ELSE
  369.         IMPORT_CFM_FUNCTION    AEPutDesc
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal OSErr AEGetNthPtr(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  374. ;
  375.     IF ¬ GENERATINGCFM THEN
  376.         Macro
  377.         _AEGetNthPtr
  378.             move.w    #$100A,d0
  379.             dc.w     $A816
  380.         EndM
  381.     ELSE
  382.         IMPORT_CFM_FUNCTION    AEGetNthPtr
  383.     ENDIF
  384.  
  385. ;
  386. ; pascal OSErr AEGetNthDesc(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, AEDesc *result)
  387. ;
  388.     IF ¬ GENERATINGCFM THEN
  389.         Macro
  390.         _AEGetNthDesc
  391.             move.w    #$0A0B,d0
  392.             dc.w     $A816
  393.         EndM
  394.     ELSE
  395.         IMPORT_CFM_FUNCTION    AEGetNthDesc
  396.     ENDIF
  397.  
  398. ;
  399. ; pascal OSErr AESizeOfNthItem(const AEDescList *theAEDescList, long index, DescType *typeCode, Size *dataSize)
  400. ;
  401.     IF ¬ GENERATINGCFM THEN
  402.         Macro
  403.         _AESizeOfNthItem
  404.             move.w    #$082A,d0
  405.             dc.w     $A816
  406.         EndM
  407.     ELSE
  408.         IMPORT_CFM_FUNCTION    AESizeOfNthItem
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal OSErr AEGetArray(const AEDescList *theAEDescList, AEArrayType arrayType, AEArrayDataPointer arrayPtr, Size maximumSize, DescType *itemType, Size *itemSize, long *itemCount)
  413. ;
  414.     IF ¬ GENERATINGCFM THEN
  415.         Macro
  416.         _AEGetArray
  417.             move.w    #$0D0C,d0
  418.             dc.w     $A816
  419.         EndM
  420.     ELSE
  421.         IMPORT_CFM_FUNCTION    AEGetArray
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal OSErr AEPutArray(AEDescList *theAEDescList, AEArrayType arrayType, const AEArrayData *arrayPtr, DescType itemType, Size itemSize, long itemCount)
  426. ;
  427.     IF ¬ GENERATINGCFM THEN
  428.         Macro
  429.         _AEPutArray
  430.             move.w    #$0B0D,d0
  431.             dc.w     $A816
  432.         EndM
  433.     ELSE
  434.         IMPORT_CFM_FUNCTION    AEPutArray
  435.     ENDIF
  436.  
  437. ;
  438. ; pascal OSErr AEDeleteItem(AEDescList *theAEDescList, long index)
  439. ;
  440.     IF ¬ GENERATINGCFM THEN
  441.         Macro
  442.         _AEDeleteItem
  443.             move.w    #$040E,d0
  444.             dc.w     $A816
  445.         EndM
  446.     ELSE
  447.         IMPORT_CFM_FUNCTION    AEDeleteItem
  448.     ENDIF
  449.  
  450. ;*************************************************************************
  451. ; The following calls apply to AERecord. Since AERecord is a subtype of
  452. ; AEDescList, the calls in the previous sections can also be used for
  453. ; AERecord an AERecord can be created by using AECreateList with isRecord
  454. ; set to true. 
  455. ;*************************************************************************
  456. ;
  457. ; pascal OSErr AEPutParamPtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
  458. ;
  459.     IF ¬ GENERATINGCFM THEN
  460.         Macro
  461.         _AEPutParamPtr
  462.             move.w    #$0A0F,d0
  463.             dc.w     $A816
  464.         EndM
  465.     ELSE
  466.         IMPORT_CFM_FUNCTION    AEPutParamPtr
  467.     ENDIF
  468.  
  469. ;
  470. ; pascal OSErr AEPutParamDesc(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
  471. ;
  472.     IF ¬ GENERATINGCFM THEN
  473.         Macro
  474.         _AEPutParamDesc
  475.             move.w    #$0610,d0
  476.             dc.w     $A816
  477.         EndM
  478.     ELSE
  479.         IMPORT_CFM_FUNCTION    AEPutParamDesc
  480.     ENDIF
  481.  
  482. ;
  483. ; pascal OSErr AEGetParamPtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  484. ;
  485.     IF ¬ GENERATINGCFM THEN
  486.         Macro
  487.         _AEGetParamPtr
  488.             move.w    #$0E11,d0
  489.             dc.w     $A816
  490.         EndM
  491.     ELSE
  492.         IMPORT_CFM_FUNCTION    AEGetParamPtr
  493.     ENDIF
  494.  
  495. ;
  496. ; pascal OSErr AEGetParamDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
  497. ;
  498.     IF ¬ GENERATINGCFM THEN
  499.         Macro
  500.         _AEGetParamDesc
  501.             move.w    #$0812,d0
  502.             dc.w     $A816
  503.         EndM
  504.     ELSE
  505.         IMPORT_CFM_FUNCTION    AEGetParamDesc
  506.     ENDIF
  507.  
  508. ;
  509. ; pascal OSErr AESizeOfParam(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
  510. ;
  511.     IF ¬ GENERATINGCFM THEN
  512.         Macro
  513.         _AESizeOfParam
  514.             move.w    #$0829,d0
  515.             dc.w     $A816
  516.         EndM
  517.     ELSE
  518.         IMPORT_CFM_FUNCTION    AESizeOfParam
  519.     ENDIF
  520.  
  521. ;
  522. ; pascal OSErr AEDeleteParam(AppleEvent *theAppleEvent, AEKeyword theAEKeyword)
  523. ;
  524.     IF ¬ GENERATINGCFM THEN
  525.         Macro
  526.         _AEDeleteParam
  527.             move.w    #$0413,d0
  528.             dc.w     $A816
  529.         EndM
  530.     ELSE
  531.         IMPORT_CFM_FUNCTION    AEDeleteParam
  532.     ENDIF
  533.  
  534. ;*************************************************************************
  535. ; The following calls also apply to type AppleEvent. Message attributes are
  536. ; far more restricted, and can only be accessed through the following 5
  537. ; calls. The various list and record routines cannot be used to access the
  538. ; attributes of an event. 
  539. ;*************************************************************************
  540. ;
  541. ; pascal OSErr AEGetAttributePtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  542. ;
  543.     IF ¬ GENERATINGCFM THEN
  544.         Macro
  545.         _AEGetAttributePtr
  546.             move.w    #$0E15,d0
  547.             dc.w     $A816
  548.         EndM
  549.     ELSE
  550.         IMPORT_CFM_FUNCTION    AEGetAttributePtr
  551.     ENDIF
  552.  
  553. ;
  554. ; pascal OSErr AEGetAttributeDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
  555. ;
  556.     IF ¬ GENERATINGCFM THEN
  557.         Macro
  558.         _AEGetAttributeDesc
  559.             move.w    #$0826,d0
  560.             dc.w     $A816
  561.         EndM
  562.     ELSE
  563.         IMPORT_CFM_FUNCTION    AEGetAttributeDesc
  564.     ENDIF
  565.  
  566. ;
  567. ; pascal OSErr AESizeOfAttribute(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
  568. ;
  569.     IF ¬ GENERATINGCFM THEN
  570.         Macro
  571.         _AESizeOfAttribute
  572.             move.w    #$0828,d0
  573.             dc.w     $A816
  574.         EndM
  575.     ELSE
  576.         IMPORT_CFM_FUNCTION    AESizeOfAttribute
  577.     ENDIF
  578.  
  579. ;
  580. ; pascal OSErr AEPutAttributePtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
  581. ;
  582.     IF ¬ GENERATINGCFM THEN
  583.         Macro
  584.         _AEPutAttributePtr
  585.             move.w    #$0A16,d0
  586.             dc.w     $A816
  587.         EndM
  588.     ELSE
  589.         IMPORT_CFM_FUNCTION    AEPutAttributePtr
  590.     ENDIF
  591.  
  592. ;
  593. ; pascal OSErr AEPutAttributeDesc(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
  594. ;
  595.     IF ¬ GENERATINGCFM THEN
  596.         Macro
  597.         _AEPutAttributeDesc
  598.             move.w    #$0627,d0
  599.             dc.w     $A816
  600.         EndM
  601.     ELSE
  602.         IMPORT_CFM_FUNCTION    AEPutAttributeDesc
  603.     ENDIF
  604.  
  605. ;*************************************************************************
  606. ;  The next couple of calls are basic routines used to create, send,
  607. ;  and process AppleEvents. 
  608. ;*************************************************************************
  609. ;
  610. ; pascal OSErr AECreateAppleEvent(AEEventClass theAEEventClass, AEEventID theAEEventID, const AEAddressDesc *target, short returnID, long transactionID, AppleEvent *result)
  611. ;
  612.     IF ¬ GENERATINGCFM THEN
  613.         Macro
  614.         _AECreateAppleEvent
  615.             move.w    #$0B14,d0
  616.             dc.w     $A816
  617.         EndM
  618.     ELSE
  619.         IMPORT_CFM_FUNCTION    AECreateAppleEvent
  620.     ENDIF
  621.  
  622. ;
  623. ; pascal OSErr AESend(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc)
  624. ;
  625.     IF ¬ GENERATINGCFM THEN
  626.         Macro
  627.         _AESend
  628.             move.w    #$0D17,d0
  629.             dc.w     $A816
  630.         EndM
  631.     ELSE
  632.         IMPORT_CFM_FUNCTION    AESend
  633.     ENDIF
  634.  
  635. ;
  636. ; pascal OSErr AEProcessAppleEvent(const EventRecord *theEventRecord)
  637. ;
  638.     IF ¬ GENERATINGCFM THEN
  639.         Macro
  640.         _AEProcessAppleEvent
  641.             move.w    #$021B,d0
  642.             dc.w     $A816
  643.         EndM
  644.     ELSE
  645.         IMPORT_CFM_FUNCTION    AEProcessAppleEvent
  646.     ENDIF
  647.  
  648. ; Note: during event processing, an event handler may realize that it is likely
  649. ; to exceed the client's timeout limit. Passing the reply to this
  650. ; routine causes a wait event to be generated that asks the client
  651. ; for more time. 
  652. ;
  653. ;
  654. ; pascal OSErr AEResetTimer(const AppleEvent *reply)
  655. ;
  656.     IF ¬ GENERATINGCFM THEN
  657.         Macro
  658.         _AEResetTimer
  659.             move.w    #$0219,d0
  660.             dc.w     $A816
  661.         EndM
  662.     ELSE
  663.         IMPORT_CFM_FUNCTION    AEResetTimer
  664.     ENDIF
  665.  
  666. ;*************************************************************************
  667. ; The following four calls are available for applications which need more
  668. ; sophisticated control over when and how events are processed. Applications
  669. ; which implement multi-session servers or which implement their own
  670. ; internal event queueing will probably be the major clients of these
  671. ; routines. They can be called from within a handler to prevent the AEM from
  672. ; disposing of the AppleEvent when the handler returns. They can be used to
  673. ; asynchronously process the event (as MacApp does).
  674. ;*************************************************************************
  675. ;
  676. ; pascal OSErr AESuspendTheCurrentEvent(const AppleEvent *theAppleEvent)
  677. ;
  678.     IF ¬ GENERATINGCFM THEN
  679.         Macro
  680.         _AESuspendTheCurrentEvent
  681.             move.w    #$022B,d0
  682.             dc.w     $A816
  683.         EndM
  684.     ELSE
  685.         IMPORT_CFM_FUNCTION    AESuspendTheCurrentEvent
  686.     ENDIF
  687.  
  688. ; Note: The following routine tells the AppleEvent manager that processing
  689. ; is either about to resume or has been completed on a previously suspended
  690. ; event. The procPtr passed in as the dispatcher parameter will be called to
  691. ; attempt to redispatch the event. Several constants for the dispatcher
  692. ; parameter allow special behavior. They are:
  693. ;      - kAEUseStandardDispatch means redispatch as if the event was just
  694. ;      received, using the standard AppleEvent dispatch mechanism.
  695. ;      - kAENoDispatch means ignore the parameter.
  696. ;         Use this in the case where the event has been handled and no
  697. ;      redispatch is needed.
  698. ;      - non nil means call the routine which the dispatcher points to.
  699. ;
  700. ;
  701. ; pascal OSErr AEResumeTheCurrentEvent(const AppleEvent *theAppleEvent, const AppleEvent *reply, AEEventHandlerUPP dispatcher, long handlerRefcon)
  702. ;
  703.     IF ¬ GENERATINGCFM THEN
  704.         Macro
  705.         _AEResumeTheCurrentEvent
  706.             move.w    #$0818,d0
  707.             dc.w     $A816
  708.         EndM
  709.     ELSE
  710.         IMPORT_CFM_FUNCTION    AEResumeTheCurrentEvent
  711.     ENDIF
  712.  
  713. ;
  714. ; pascal OSErr AEGetTheCurrentEvent(AppleEvent *theAppleEvent)
  715. ;
  716.     IF ¬ GENERATINGCFM THEN
  717.         Macro
  718.         _AEGetTheCurrentEvent
  719.             move.w    #$021A,d0
  720.             dc.w     $A816
  721.         EndM
  722.     ELSE
  723.         IMPORT_CFM_FUNCTION    AEGetTheCurrentEvent
  724.     ENDIF
  725.  
  726. ;
  727. ; pascal OSErr AESetTheCurrentEvent(const AppleEvent *theAppleEvent)
  728. ;
  729.     IF ¬ GENERATINGCFM THEN
  730.         Macro
  731.         _AESetTheCurrentEvent
  732.             move.w    #$022C,d0
  733.             dc.w     $A816
  734.         EndM
  735.     ELSE
  736.         IMPORT_CFM_FUNCTION    AESetTheCurrentEvent
  737.     ENDIF
  738.  
  739. ;*************************************************************************
  740. ;  The following three calls are used to allow applications to behave
  741. ;  courteously when a user interaction such as a dialog box is needed. 
  742. ;*************************************************************************
  743. ;
  744. ; pascal OSErr AEGetInteractionAllowed(AEInteractAllowed *level)
  745. ;
  746.     IF ¬ GENERATINGCFM THEN
  747.         Macro
  748.         _AEGetInteractionAllowed
  749.             move.w    #$021D,d0
  750.             dc.w     $A816
  751.         EndM
  752.     ELSE
  753.         IMPORT_CFM_FUNCTION    AEGetInteractionAllowed
  754.     ENDIF
  755.  
  756. ;
  757. ; pascal OSErr AESetInteractionAllowed(AEInteractAllowed level)
  758. ;
  759.     IF ¬ GENERATINGCFM THEN
  760.         Macro
  761.         _AESetInteractionAllowed
  762.             move.w    #$011E,d0
  763.             dc.w     $A816
  764.         EndM
  765.     ELSE
  766.         IMPORT_CFM_FUNCTION    AESetInteractionAllowed
  767.     ENDIF
  768.  
  769. ;
  770. ; pascal OSErr AEInteractWithUser(long timeOutInTicks, NMRecPtr nmReqPtr, AEIdleUPP idleProc)
  771. ;
  772.     IF ¬ GENERATINGCFM THEN
  773.         Macro
  774.         _AEInteractWithUser
  775.             move.w    #$061C,d0
  776.             dc.w     $A816
  777.         EndM
  778.     ELSE
  779.         IMPORT_CFM_FUNCTION    AEInteractWithUser
  780.     ENDIF
  781.  
  782. ;*************************************************************************
  783. ;  These calls are used to set up and modify the event dispatch table.
  784. ;*************************************************************************
  785. ;
  786. ; pascal OSErr AEInstallEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, long handlerRefcon, Boolean isSysHandler)
  787. ;
  788.     IF ¬ GENERATINGCFM THEN
  789.         Macro
  790.         _AEInstallEventHandler
  791.             move.w    #$091F,d0
  792.             dc.w     $A816
  793.         EndM
  794.     ELSE
  795.         IMPORT_CFM_FUNCTION    AEInstallEventHandler
  796.     ENDIF
  797.  
  798. ;
  799. ; pascal OSErr AERemoveEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, Boolean isSysHandler)
  800. ;
  801.     IF ¬ GENERATINGCFM THEN
  802.         Macro
  803.         _AERemoveEventHandler
  804.             move.w    #$0720,d0
  805.             dc.w     $A816
  806.         EndM
  807.     ELSE
  808.         IMPORT_CFM_FUNCTION    AERemoveEventHandler
  809.     ENDIF
  810.  
  811. ;
  812. ; pascal OSErr AEGetEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP *handler, long *handlerRefcon, Boolean isSysHandler)
  813. ;
  814.     IF ¬ GENERATINGCFM THEN
  815.         Macro
  816.         _AEGetEventHandler
  817.             move.w    #$0921,d0
  818.             dc.w     $A816
  819.         EndM
  820.     ELSE
  821.         IMPORT_CFM_FUNCTION    AEGetEventHandler
  822.     ENDIF
  823.  
  824. ;*************************************************************************
  825. ;  These calls are used to set up and modify the coercion dispatch table.
  826. ;*************************************************************************
  827. ;
  828. ; pascal OSErr AEInstallCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP handler, long handlerRefcon, Boolean fromTypeIsDesc, Boolean isSysHandler)
  829. ;
  830.     IF ¬ GENERATINGCFM THEN
  831.         Macro
  832.         _AEInstallCoercionHandler
  833.             move.w    #$0A22,d0
  834.             dc.w     $A816
  835.         EndM
  836.     ELSE
  837.         IMPORT_CFM_FUNCTION    AEInstallCoercionHandler
  838.     ENDIF
  839.  
  840. ;
  841. ; pascal OSErr AERemoveCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP handler, Boolean isSysHandler)
  842. ;
  843.     IF ¬ GENERATINGCFM THEN
  844.         Macro
  845.         _AERemoveCoercionHandler
  846.             move.w    #$0723,d0
  847.             dc.w     $A816
  848.         EndM
  849.     ELSE
  850.         IMPORT_CFM_FUNCTION    AERemoveCoercionHandler
  851.     ENDIF
  852.  
  853. ;
  854. ; pascal OSErr AEGetCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP *handler, long *handlerRefcon, Boolean *fromTypeIsDesc, Boolean isSysHandler)
  855. ;
  856.     IF ¬ GENERATINGCFM THEN
  857.         Macro
  858.         _AEGetCoercionHandler
  859.             move.w    #$0B24,d0
  860.             dc.w     $A816
  861.         EndM
  862.     ELSE
  863.         IMPORT_CFM_FUNCTION    AEGetCoercionHandler
  864.     ENDIF
  865.  
  866. ;*************************************************************************
  867. ;  These calls are used to set up and modify special hooks into the
  868. ;  AppleEvent manager.
  869. ;*************************************************************************
  870. ;
  871. ; pascal OSErr AEInstallSpecialHandler(AEKeyword functionClass, UniversalProcPtr handler, Boolean isSysHandler)
  872. ;
  873.     IF ¬ GENERATINGCFM THEN
  874.         Macro
  875.         _AEInstallSpecialHandler
  876.             move.w    #$0500,d0
  877.             dc.w     $A816
  878.         EndM
  879.     ELSE
  880.         IMPORT_CFM_FUNCTION    AEInstallSpecialHandler
  881.     ENDIF
  882.  
  883. ;
  884. ; pascal OSErr AERemoveSpecialHandler(AEKeyword functionClass, UniversalProcPtr handler, Boolean isSysHandler)
  885. ;
  886.     IF ¬ GENERATINGCFM THEN
  887.         Macro
  888.         _AERemoveSpecialHandler
  889.             move.w    #$0501,d0
  890.             dc.w     $A816
  891.         EndM
  892.     ELSE
  893.         IMPORT_CFM_FUNCTION    AERemoveSpecialHandler
  894.     ENDIF
  895.  
  896. ;
  897. ; pascal OSErr AEGetSpecialHandler(AEKeyword functionClass, UniversalProcPtr *handler, Boolean isSysHandler)
  898. ;
  899.     IF ¬ GENERATINGCFM THEN
  900.         Macro
  901.         _AEGetSpecialHandler
  902.             move.w    #$052D,d0
  903.             dc.w     $A816
  904.         EndM
  905.     ELSE
  906.         IMPORT_CFM_FUNCTION    AEGetSpecialHandler
  907.     ENDIF
  908.  
  909. ;*************************************************************************
  910. ;  This call was added in version 1.0.1. If called with the keyword
  911. ;  keyAERecorderCount ('recr'), the number of recorders that are
  912. ;  currently active is returned in 'result'.
  913. ;*************************************************************************
  914. ; available only in vers 1.0.1 and greater 
  915. ;
  916. ; pascal OSErr AEManagerInfo(AEKeyword keyWord, long *result)
  917. ;
  918.     IF ¬ GENERATINGCFM THEN
  919.         Macro
  920.         _AEManagerInfo
  921.             move.w    #$0441,d0
  922.             dc.w     $A816
  923.         EndM
  924.     ELSE
  925.         IMPORT_CFM_FUNCTION    AEManagerInfo
  926.     ENDIF
  927.  
  928.     ENDIF ; __APPLEEVENTS__
  929.